// index.ts
// 获取应用实例
const app = getApp<IAppOption>()

import util from '../../utils/util'
import api from '../../config/api'

Page({
  data: {
    motto: 'Hello World',
    userInfo: {
      nickName: '',
    },
    channel: new Array<any>(),
    newGoods:[],
  },
  onLoad:function(){
       this.getIndexData()
  },
  getIndexData:function(){

    let that = this;


     wx.request({
       url:'https://fly2you.cn/platform-framework/api/index/channel',
       method:'POST',
       dataType:'json',
       success:function(res:any){
          that.setData({
            channel:res.data.data.channel 
          })   
       }
     })


     wx.request({
      url:'https://fly2you.cn/platform-framework/api/index/newGoods',
      method:'POST',
      dataType:'json',
      success:function(res:any){

         console.log(res.data.data.newGoodsList);
         that.setData({
          newGoods:res.data.data.newGoodsList 
         })   
      }
    })

   



  }

})
